<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>商品列表页- ${web.name}${web.additionalTitle!}</title>
<script src="${sysResRoot}/jquery.js" type="text/javascript"></script>
<link href="${root}/u/css/main.css" type="text/css" rel="stylesheet" />
<link href="${root}/u/css/memeber.css" type="text/css" rel="stylesheet" />
<link href="${sysResRoot}/front.css" rel="stylesheet" type="text/css"/>
<link href="${base}/res/common/css/jquery.ui.css" rel="stylesheet" type="text/css"/>
<script src="${base}/res/common/js/jquery.js" type="text/javascript"></script>
<script src="${base}/thirdparty/fckeditor/fckeditor.js" type="text/javascript"></script>
<script type="text/javascript">
function g(o){
	return document.getElementById(o);
}
function getTableForm(){
	return document.getElementById("tableForm");
}
function optShangjia(){
	  if(Pn.checkedCount('ids')<=0){
		  alert("请选择商品");
		  return;
	  }
	  if(!confirm("确定要上架?")) {
			return;
	  }
	  var f=document.getElementById('tableForm');
	  f.action="v_shangjia.jspx";
	  f.submit();
}
function optXiajia(){
	  if(Pn.checkedCount('ids')<=0){
		  alert("请选择商品");
		  return;
	  }
	  if(!confirm("确定要下架?")) {
			return;
	  }
	  var f=document.getElementById('tableForm');
	  f.action="v_xiajia.jspx";
	  f.submit();
}
function check(o){
	 var a = document.getElementsByName("ids");
		    for (var i=0;i<a.length;i++){
		       a[i].checked = o.checked;
	 	    }
}
</script>
</head>
<body>
[#include "../include/shop_top.html"/]
<div class="w1168">
	[#include "店铺中心_导航.html"/]
	<div class="user_right">
		<div class="user_title2">出售中宝贝</div>
    	<div class="clear10"></div> 
        <form id="tableForm" action="${base}/product/v_list.jspx" method="post">
        <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#cccccc" style="font-size:12px;">
        <tr>
        <td width="30" height="30" align="center" bgcolor="#f0f0f0"><input type='checkbox' onclick="check(this)"></td>
        <td width="40" height="30" align="center" bgcolor="#f0f0f0">ID</td>
        <td align="center" bgcolor="#f0f0f0">标题</td>
        <td width="110" align="center" bgcolor="#f0f0f0">类别</td>
        <td width="110" align="center" bgcolor="#f0f0f0">类型</td>
        <td width="80" align="center" bgcolor="#f0f0f0">销售价</td>
        <td width="80" align="center" bgcolor="#f0f0f0">库存</td>
        
        <td width="70" align="center" bgcolor="#F0F0F0">上/下架</td>
        
        <td width="80" align="center" bgcolor="#f0f0f0">禁售</td>
        
        <td width="100" align="center" bgcolor="#f0f0f0">操作选项</td>
        </tr>
        </table>
        [#if pagination??]
        [#if pagination.list?size gt 0]
        <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1">
        [#list pagination.list as c]
        <tr>	
        <td width="30" height="50" align="center" bgcolor="#FFFFFF">  <input type='checkbox' name='ids' value='${c.id}'/></td>
        <td width="40" align="center" bgcolor="#FFFFFF">${c.id}</td>
        <td align="left" bgcolor="#FFFFFF" style="text-align: center;"> <a href="${c.url!}" target="_self" style="color:#333; text-decoration:none;">[@text_cut s=c.name len='15' append='...'/]</a></td>
        <td width="110" align="center" bgcolor="#FFFFFF">${c.category.name}</td>
        <td width="110" align="center" bgcolor="#FFFFFF">${c.type.name}</td>
        <td width="80" align="center" bgcolor="#FFFFFF">${c.salePrice}</td>
        <td width="80" align="center" bgcolor="#FFFFFF">${c.stockCount}</td>
        <td width="70" align="center" bgcolor="#FFFFFF">[#if c.onSale] <a href="a_update.jspx?id=${c.id}&pageNo=${pageNo!}&ctgId==${(c.category.id)!}" ><input type="button" value="下架"></a>[#else] <a href="a_update.jspx?id=${c.id}&pageNo=${pageNo!}&ctgId==${(c.category.id)!}"><input type="button" value="上架"></a>[/#if]</td>
        <td width="80" align="center" bgcolor="#FFFFFF">
        [#if c.prohibit??]
        [#if c.prohibit]  未禁售      
        [#else]已禁售
        [/#if]
        [#else]   未禁售
        [/#if]
        </td>
        
        <td width="100" align="center" bgcolor="#FFFFFF">
        <a href="v_edit.jspx?id=${c.id}&pageNo=${pageNo!}&ctgId=${(c.category.id)!}">修改</a> | 
        <a href="o_delete.jspx?ids=${c.id}&pageNo=${pageNo!}&ctgId=${(c.category.id)!}" onclick="if(!confirm('确定删除')) {return false;}">删除</a></td>
        </tr>
        <tr>
        <td height="1" colspan="10" bgcolor="#e7e7e7"></td>
        </tr>
        [/#list]
        </table>
        <div class="clear10"></div>
        <div><input type="button" value="下架" onclick="optXiajia();" class="menu_ok">&nbsp;<input type="button" value="上架" onclick="optShangjia();" class="menu_ok"></div>
        
        <div style="height:10px; width:100%;"></div>
        <input type="hidden" name="pageNo" value="${pageNo}"/>
        <table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td height="50" align="center" class="pn-sp" style="font-size:12px;">
        共 ${pagination.totalCount} 条 
        每页 ${pagination.pageSize} 条 
        <input type="button" value="首 页" onclick="_gotoPage('1');"[#if pagination.firstPage] disabled="disabled"[/#if]/>
        <input type="button" value="上一页" onclick="_gotoPage('${pagination.prePage}');"[#if pagination.firstPage] disabled="disabled"[/#if]/>
        <input type="button" value="下一页" onclick="_gotoPage('${pagination.nextPage}');"[#if pagination.lastPage] disabled="disabled"[/#if]/>
        <input type="button" value="尾 页" onclick="_gotoPage('${pagination.totalPage}');"[#if pagination.lastPage] disabled="disabled"[/#if]/> 
        当前 ${pagination.pageNo}/${pagination.totalPage} 页  转到第<input type="text" id="_goPs" style="width:50px" onfocus="this.select();" onkeypress="if(event.keyCode==13){$('#_goPage').click();return false;}"/>页
        <input id="_goPage" type="button" value="转" onclick="_gotoPage($('#_goPs').val());"[#if pagination.totalPage==1] disabled="disabled"[/#if]/>
        </td>
        </tr>
        </table>
        <script type="text/javascript">
        function _gotoPage(pageNo) {
        try{
        var tableForm = document.getElementById("tableForm");
        $("input[name=pageNo]").val(pageNo);
        tableForm.action="${base}/product/v_list.jspx";
        tableForm.onsubmit=null;
        tableForm.submit();
        } catch(e) {
        alert('_gotoPage(pageNo)方法出错');
        }
        }
        </script>
        [#else]
        <div align="center">暂无数据</div>
        [/#if]
        [#else]
        <div>没有栏目权限</div>
        [/#if]
        </form>
    </div>
	<div class="clear20"></div>
</div>
[#include "../include/footer_information_bar.html"/]
</body>
</html>